package Demo4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-22
 * Time: 15:54
 */
import java.util.Scanner;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        int[] a = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

        Scanner sc = new Scanner(System.in);
        int m = 0;
        try {
            int n = sc.nextInt();
            m = n;
        }
        catch (InputMismatchException e){
            System.out.println("c");
        }

        for (int i = 0; i < m; i++) {
            try {
                int x = sc.nextInt();
                System.out.println(1/a[x]);
            }
            catch (ArrayIndexOutOfBoundsException e){
                System.out.println("catch a InputMismatchException");
            }
            catch (InputMismatchException e){
                System.out.println("catch a ArrayIndexOutOfBoundsException");
            }
            catch (ArithmeticException e){
                System.out.println("catch a ArithmeticException");
            }
        }
        /* 请在这里填写答案 */
    }
}

